package org.gdpu.Service.Impl;

import org.gdpu.Service.DormitoryService;
import org.gdpu.Service.ExpenseService;
import org.gdpu.Service.StudentService;
import org.gdpu.base.DaoSupport;
import org.gdpu.model.Expense;
import org.gdpu.model.Monitor;
import org.gdpu.model.Student;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by HEWI2 on 2/17/14.
 */

@Service
@Transactional
public class ExpenseServiceImpl extends DaoSupport<Expense> implements ExpenseService {

    private DormitoryService dormitoryService;

    @Override
    public Expense findExpense(String dormitory,String campusName){
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("dormitory", dormitoryService.findById(dormitory,campusName));
        return (Expense) this.findSpecialObject(Expense.class, params);
    }


    @Resource(name = "dormitoryServiceImpl")
    public void setDormitoryService(DormitoryService dormitoryService) {
        this.dormitoryService = dormitoryService;
    }


}
